package com.hkp.demo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 专项规则关联表
 * </p>
 *
 * @author HuKangPing
 * @since 2023-02-22 14:20:35
 */
@Data
@TableName("t02_rule")
@ApiModel(value = "Rule对象", description = "专项规则关联表")
public class Rule implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("专项id")
    private Integer projectId;

    @ApiModelProperty("规则名称")
    private String ruleName;

    @ApiModelProperty("规则描述")
    private String remark;

    @ApiModelProperty("权重")
    private Float weight;

    @ApiModelProperty("规则维度")
    private String ruleDim;

    @ApiModelProperty("质量规则分类编号, 对应t02_rule_class表中的class_no")
    private String ruleClassNo;

    @ApiModelProperty("创建类型，1：模板创建，2：自定义创建")
    private String createType;

    @ApiModelProperty("数据源id")
    private String datasourceId;

    @ApiModelProperty("数据源用户")
    private String userName;

    @ApiModelProperty("稽核的Schema")
    private String schemaName;

    @ApiModelProperty("模板id")
    private String templateId;

    @ApiModelProperty("执行sql")
    private String execSql;

    @ApiModelProperty("复核sql， 用于查询异常数据")
    private String checkSql;

    @ApiModelProperty("用于查询总数")
    private String countSql;

    @ApiModelProperty("执行模式，online：在线执行，offline：离线执行")
    private String execMode;

    @ApiModelProperty("影响范围")
    private String influenceSphere;

    @ApiModelProperty("异常告警方式，1：邮件")
    private String alarmType;

    @ApiModelProperty("告警级别， 字典配置，1: 正常，2：警告，3：严重，4：错误")
    private String alarmLevel;

    @ApiModelProperty("正常阈值, 0到100之间取值")
    private Float normalVal;

    @ApiModelProperty("警告阈值, 0到100之间取值")
    private Float warnVal;

    @ApiModelProperty("负责人id")
    private String managerId;

    @ApiModelProperty("创建人id")
    private String creatorId;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty("最后修改人")
    private String lastModifierId;

    @ApiModelProperty("最后修改时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastModifyTime;

    @ApiModelProperty("错误结果保留天数")
    private Integer errorDataRetainDay;

    @ApiModelProperty("错误数据保留条数")
    private Integer errorDataRetainCount;

    @ApiModelProperty("是否推送工单，0不推送 1推送")
    private String pushTodo;

    @ApiModelProperty("是否预处理脚本： 0 是,1不是")
    private String preprocess;


}
